﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBMigrator.Core.DbObjects.Data.Select;
using Xunit;

namespace DBMigrator.Core.Tests.DbObjects.Data
{
    public class FromTableTests
    {
        [Fact]
        public void ConstructorShouldThrowIfTableNameIsNull()
        {
            Assert.Throws<ArgumentNullException>(() => new FromTable(null));
        }

        [Fact]
        public void ConstructorShouldThrowIfTableNameIsEmpty()
        {
            Assert.Throws<ArgumentNullException>(() => new FromTable(string.Empty));
        }

        [Fact]
        public void ConstructorShouldSetTableName()
        {
            var tableName = StringUtil.Random();
            Assert.Equal(tableName, new FromTable(tableName).TableName);
        }
    }
}
